Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input fields that allow the user to assign values to various parameters #115

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

mahendrark
Copy link
Contributor

Fix #114

Changes proposed in this pull request:

  • Your_changes

The following steps were realized, as well (if applies):

  • Apply black (black . --exclude docs/)
  • Update the CHANGELOG.md

The following optional steps were realized:

  • Use in-line comments to explain your code
  • Write docstrings to your code
  • For new functionalities: explain in readthedocs
  • Write test(s) for your new patch of code

For more information on how to contribute check the [CONTRIBUTING.md](https://github.com/rl
-institut/open_plan/blob/dev/CONTRIBUTING.md).

@mahendrark
Copy link
Contributor Author

mahendrark commented Feb 15, 2021

Initial workflow proposal:

  1. Create a dictionary in macro in create_project.html with 5 different parameters for project parameters.
  2. Loop through this dictionary and create Foundation form elements with input data fields. Docs here and here
  3. The input fields must have the attributes described in the docs here

After successful initial workflow execution:

  1. Add option (above the input fields) to load a CSV file which is then converted to a Pandas DF and from which the parameters and their values are determined. This can be saved into a dictionary (same as the one hardcoded above).
  2. If user decide to load the parameters from disk system, then step 1 is executed and the values of the parameters must be populated automatically in the input fields, from the dictionary obtained in step 1.

@Bachibouzouk comments?

@mahendrark mahendrark added the enhancement New feature or request label Feb 15, 2021
@mahendrark
Copy link
Contributor Author

mahendrark commented Feb 15, 2021

Tasks to do:

  1. Fix the layout of the input fields
  2. Auto fill the fields with values from csv, if the user loads in a csv using the button above the input fields (example here)
  3. Add styling to the view-component

@mahendrark mahendrark closed this Feb 18, 2021
@mahendrark mahendrark force-pushed the feature/add_input_fields branch from bff27b6 to 0693f03 Compare February 18, 2021 13:44
@mahendrark mahendrark reopened this Feb 18, 2021
@mahendrark
Copy link
Contributor Author

@Bachibouzouk

I did some preliminary work, but there are some problems.
Like for e.g.: The default values and type of data for each field (numerical or textual) does not work. I think the problem is how I am trying to access the value from dictionaries. Can you please take a look?

<div class="cell grid-x">
<label class="cell small-6 input_field_labels">{{ param }}</label>
{% for (param_info, value) in param_details.items() %}
{% if param_info == 'docs_link' %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you loop here, you can assess the value directly with param_details["docs_link"]

@@ -5,6 +5,15 @@
<!-- WRITE HTML CODE WITHIN THESE block content TAGS -->
{% block content %}

{% set project_parameters={
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the structure should be a list of dicts (you can move the name inside with the key name or label for example

@Bachibouzouk
Copy link
Contributor

Bachibouzouk commented Feb 20, 2021

We should probably create models and use ModelForm to render the inputs from the model instances. The column value will pose problem in a database if the values are from different types (text, number, array), we could avoid that problem by creating one Modelclass per parameter type, that way the types in the column values will not be mixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing options to allow users to input data
2 participants